﻿using Baidu.Api.Response;
using Baidu.Api.Util;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Baidu.Api.Request
{
    public class MetaListGetRequest : IBaiduRequest<MetaListGetResponse>
    {
        public string[] Param { get; set; }

        #region IBaiduRequest

        public string GetObjectName()
        {
            return "pcs/file";
        }

        public string GetMethod()
        {
            return "meta";
        }

        public IDictionary<string, string> GetFormParameters()
        {
            BaiduDictionary parameters = new BaiduDictionary();
            var array = new ArrayList();
            foreach (var p in Param)
            {
                array.Add(new { path = p });
            }
            parameters.Add("param", Newtonsoft.Json.JsonConvert.SerializeObject(new { list = array }));
            return parameters;
        }

        public void Validate()
        {
        }

        #endregion
    }
}
